<template>
	<view >
		<view v-for="(item,index) in datalist" :key='index' >
		 <view class="information" >
		 	  <view class="name">
		 	  	 <span class='user'>{{item.user_info.nickname}}</span>
				 <span class='time'>{{dateformate(item.create_time)}}</span>
		 	  </view>
			  <view class="content" v-if="!item.evaluate_info">
			  	  用户没有填写评价
			  </view>
			  <view class="conmore" >
			  	<view class="content content1"  v-if="item.evaluate_info">
			  		{{item.evaluate_info.content}}
			  	</view>
				<view class="img" v-if="item.evaluate_info" >
					<image :src="item1" mode=""  v-for="(item1,index1) in item.evaluate_info.images_url" :key='index1'></image>
				</view>
			  </view>
		 </view>
		<view class="goods-top">
		 	<view class="goods-img">
		 		<image :src="item.cover_url" mode=""></image>
		 	</view>
		 	<view class="goods-detail-text">
		 		<view class="goods">
		 			<span> {{item.title}}</span>
		 		</view>
		 		<view class="goods-species">
		 			<span>{{item.spec}}</span>
		 		</view>
				<view class="price">
					¥{{item.goods_price}}
				</view>
		 	</view>
		 </view>
		 	</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				order_id:0,
				datalist:[],
				user_info:{}
			};
		},
		onLoad(option) {
			this.order_id = option.order_id
			console.log(this.order_id);
			this.evaluationList()
		},
		methods:{
			// 获取查看列表
			evaluationList() {
				this.api.seeEvaluation({
					order_id:this.order_id,
					uid:uni.getStorageSync('uid')
				}).then(res=>{
					console.log(res.data.data);
					this.datalist = res.data.data
					
				}).catch(err=>{
					
				})
			},
			// 分割字符串
			  Unsplit(goods_spec){
				var spec = goods_spec.split(',')
				 return spec[1]+'枝/扎'+'; '+spec[0]
			  },
			// 日期格式化
			dateformate(date){
				  const dt = new Date(date * 1000)
				  const y = dt.getFullYear()
				  const m = (dt.getMonth() + 1 + '').padStart(2, '0')
				  const d = (dt.getDate() + '').padStart(2, '0')
				  const hh = (dt.getHours() + '').padStart(2, '0')
				  const mm = (dt.getMinutes() + '').padStart(2, '0')
				  const ss = (dt.getSeconds() + '').padStart(2, '0')	
				  return `${y}-${m}-${d}`
				
			}
		}
	}
</script>

<style lang="less" scoped>
		.information {
			 width: 690rpx;
			 // height: 160rpx;
			 margin: 0 auto;
			 border-bottom: 2rpx solid #EEEEEE;
			 padding: 30rpx 0;
			 box-sizing: border-box;
			 font-size: 28rpx;
			 font-family: PingFangSC-Semibold, PingFang SC;
			 font-weight: 400;
			 color: #333333;
			 .name {
				 display: flex;
				 justify-content: space-between;
				 .time {
				 	font-size: 26rpx;
				 	font-family: PingFangSC-Regular, PingFang SC;
				 	font-weight: 400;
				 	color: #999999;			 
				 }
				 .user {
					 font-weight: 600; 
				 }
			 }
			 .content {
				 margin-top: 20rpx;
			 }	
			 .content1 {
				 margin-bottom: 20rpx;
			 }
			 .img {
				 display: flex;
			 	 image {
				 width: 180rpx;
				 height: 180rpx;
				 border-radius: 8rpx;
				  margin-right: 20rpx;
				}
			 }
		}
		.goods-top {
			display: flex;
			justify-content: flex-start;
			padding: 30rpx ;
			box-sizing: border-box;
		
			.goods-img {
				width: 140rpx;
				height: 140rpx;
				margin-right: 20rpx;
				border-radius: 8px;
				
				image {
					width: 100%;
					height: 100%;
				}
			}
		
			.goods-detail-text {
				height: 180rpx;
				width: 430rpx;
				.goods {
					margin-bottom: 10rpx;
					font-size: 26rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #333333;
				}
		
				.goods-species {
					font-size: 22rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #999999;
				}
				.price {
					margin-top: 10rpx;
					font-size: 26rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #474747;
				}
			}
		}
		
</style>
